<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.2.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/lib/pace/pace-theme-minimal.min.css">
  <script src="/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"sekla.cn","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"right","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="基于 SM3 算法的 HMAC 快速实现​    csdn屎山淘金，找保密技术课题，总算找到一个靠谱的。 链接：https:&#x2F;&#x2F;blog.csdn.net&#x2F;qq_41709370&#x2F;article&#x2F;details&#x2F;106292047 原作者：Rg4sun 简介​    原文实现目标为快速实现基于 SM3 哈希函数的 HMAC 哈希运算消息认证码，并且对SM3运算函数进行了很多优化，使得HMAC计算延">
<meta property="og:type" content="article">
<meta property="og:title" content="基于SM3算法HMAC快速实现">
<meta property="og:url" content="http://sekla.cn/2021/11/24/sm3-hmac/index.html">
<meta property="og:site_name" content="Sekla&#39;s Blog">
<meta property="og:description" content="基于 SM3 算法的 HMAC 快速实现​    csdn屎山淘金，找保密技术课题，总算找到一个靠谱的。 链接：https:&#x2F;&#x2F;blog.csdn.net&#x2F;qq_41709370&#x2F;article&#x2F;details&#x2F;106292047 原作者：Rg4sun 简介​    原文实现目标为快速实现基于 SM3 哈希函数的 HMAC 哈希运算消息认证码，并且对SM3运算函数进行了很多优化，使得HMAC计算延">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2021/11/22/Hn1fMg4RBkDX8s9.png">
<meta property="og:image" content="https://i.loli.net/2021/11/22/Qp6HbPV38raXm95.png">
<meta property="og:image" content="https://i.loli.net/2021/11/22/RAlrW3OZ2LKgbXd.png">
<meta property="article:published_time" content="2021-11-24T08:30:00.000Z">
<meta property="article:modified_time" content="2021-11-24T01:33:31.153Z">
<meta property="article:author" content="Sekla">
<meta property="article:tag" content="C++">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2021/11/22/Hn1fMg4RBkDX8s9.png">

<link rel="canonical" href="http://sekla.cn/2021/11/24/sm3-hmac/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>基于SM3算法HMAC快速实现 | Sekla's Blog</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

  <script type="text/javascript" src="/js/my_js/clicklove.js"></script>
<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css">
<!-- hexo injector head_end end --></head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">Sekla's Blog</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">Keep Learning Keep Doing</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签<span class="badge">14</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类<span class="badge">23</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档<span class="badge">100</span></a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>
  <div class="reading-progress-bar"></div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="http://sekla.cn/2021/11/24/sm3-hmac/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.jpg">
      <meta itemprop="name" content="Sekla">
      <meta itemprop="description" content="Sekla">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Sekla's Blog">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          基于SM3算法HMAC快速实现
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              

              <time title="创建时间：2021-11-24 16:30:00 / 修改时间：09:33:31" itemprop="dateCreated datePublished" datetime="2021-11-24T16:30:00+08:00">2021-11-24</time>
            </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/%E8%BD%AF%E4%BB%B6%E5%AE%89%E5%85%A8/" itemprop="url" rel="index"><span itemprop="name">软件安全</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span><br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="far fa-file-word"></i>
              </span>
                <span class="post-meta-item-text">本文字数：</span>
              <span>2k</span>
            </span>
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="far fa-clock"></i>
              </span>
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              <span>2 分钟</span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="基于-SM3-算法的-HMAC-快速实现"><a href="#基于-SM3-算法的-HMAC-快速实现" class="headerlink" title="基于 SM3 算法的 HMAC 快速实现"></a>基于 SM3 算法的 HMAC 快速实现</h2><p>​    csdn屎山淘金，找保密技术课题，总算找到一个靠谱的。</p>
<p>链接：<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_41709370/article/details/106292047">https://blog.csdn.net/qq_41709370/article/details/106292047</a></p>
<p>原作者：<a target="_blank" rel="noopener" href="https://blog.csdn.net/qq_41709370">Rg4sun</a></p>
<h2 id="简介"><a href="#简介" class="headerlink" title="简介"></a>简介</h2><p>​    原文实现目标为快速实现基于 SM3 哈希函数的 HMAC 哈希运算消息认证码，并且对SM3运算函数进行了很多优化，使得HMAC计算延时维持毫秒级。</p>
<a id="more"></a>

<p>架构图：</p>
<p><img src="https://i.loli.net/2021/11/22/Hn1fMg4RBkDX8s9.png" alt="20200522230707576"></p>
<h3 id="SM3"><a href="#SM3" class="headerlink" title="SM3"></a>SM3</h3><p>SM3是国产基于哈希密码标准。</p>
<p>首先算法本质为给待加密数据加一个固定长度为256bit的指纹，然后进行处理，首先填充，让填充后的数据长度为512的整数倍。现在数据尾部加上1，然后把原始数据用64bit表示，放在最后，然后补0在尾部1和64位之间直到满足512bit的整数倍。然后进行分组，把填充后的信息按照512bit一个分组进行分组。迭代压缩得到最后的杂凑值：</p>
<p>$IV(n)=CF(IV(n-1),b(n-1)) $</p>
<p>原文实现流程图：</p>
<p><img src="https://i.loli.net/2021/11/22/Qp6HbPV38raXm95.png" alt="image-20211122203045841"></p>
<p>对长度为$L (L &lt;2^{64})$ 比特的消息m，SM3杂凑算法经过填充和迭代压缩，生成杂凑值，杂凑值长度为256比特。<br>消息扩展部分，对消息分组Bi划分为16个word(32bit)，然后扩展至132个word然后用压缩函数CF。</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">FOR j=<span class="number">16</span> TO <span class="number">67</span></span><br><span class="line">	Wj ← P1(Wj−<span class="number">16</span> ⊕Wj−<span class="number">9</span> ⊕(Wj−<span class="number">3</span> ≪ <span class="number">15</span>))⊕(Wj−<span class="number">13</span> ≪ <span class="number">7</span>)⊕Wj−<span class="number">6</span> </span><br><span class="line">ENDFOR</span><br><span class="line"></span><br><span class="line">FOR j=<span class="number">0</span> TO <span class="number">63</span> </span><br><span class="line">	Wj′= Wj ⊕Wj+<span class="number">4</span></span><br><span class="line">ENDFOR</span><br></pre></td></tr></table></figure>

<p>压缩函数：</p>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">ABCDEFGH ← V (i)</span><br><span class="line">FOR j=<span class="number">0</span> TO <span class="number">63</span> </span><br><span class="line">	SS1←((A≪<span class="number">12</span>)+E+(T_j ≪j))≪<span class="number">7</span>			</span><br><span class="line"> 	SS2 ← SS1⊕(A ≪ <span class="number">12</span>)</span><br><span class="line">	TT1 ← FF_j (A, B, C) + D + SS2 + Wj′ </span><br><span class="line">  	TT2 ← GG_j (E, F, G) + H + SS1 + Wj</span><br><span class="line">	D←C C←B≪<span class="number">9</span> B←A A←TT1 H←G</span><br><span class="line">	G ← F ≪ <span class="number">19</span> F←E</span><br><span class="line">	E ← P0(TT2)</span><br><span class="line">ENDFOR</span><br><span class="line">V(i+<span class="number">1</span>) ←ABCDEFGH⊕V(i)</span><br></pre></td></tr></table></figure>

<p>字存储格式大端法。</p>
<p>最后输出Vi杂凑值，256bit。</p>
<h3 id="HMAC"><a href="#HMAC" class="headerlink" title="HMAC"></a>HMAC</h3><p>​    HMAC是密钥相关的哈希运算消息认证码(hash-based message authentication code)。在网络协议和其他协议中广泛应用。它可以与任何迭代散列函数捆绑使用。所以原文使用的SM3算法。</p>
<p>原算法流程图:</p>
<p><img src="https://i.loli.net/2021/11/22/RAlrW3OZ2LKgbXd.png" alt="20200522231359720"></p>
<p>HMAC定义中用到一个密码hash和一个密钥key，同时定义两个不同固定字符串iPAD和oPAD：</p>
<ul>
<li>iPad=一个字节(byte)的 0x36 重复 64 次</li>
<li>oPad=一个字节(byte)的 0x5C 重复 64 次</li>
</ul>
<p>以输入 Message 为例，作如下操作:<br><code>H(K XOR oPad，H(K XOR iPad，Message))</code>，H()为SM3。</p>
<p>操作步骤如下:</p>
<ol>
<li>在密钥 K 后面填充 0，使其成为长度为 64byte 的字符串。</li>
<li>用第一步得到的 64byte 的字符串与 iPad 作按位异或;</li>
<li>将消息 Message 附加到第二步产生的 64byte 字符串后面;</li>
<li>对第三步产生的数据流用散列函数 SM3 计算消息摘要;</li>
<li>用第一步得到的 64byte 的字符串与 oPad 作按位异或;</li>
<li>将第四步生成的消息摘要附加到第五步的 64byte 字符串之后;</li>
<li>对第六步产生的数据流用散列函数 SM3 计算消息摘要，作为输出</li>
</ol>
<h3 id="代码参考"><a href="#代码参考" class="headerlink" title="代码参考"></a>代码参考</h3><p>文件/文件夹名            作用<br>SampleTest                存储 1K-100MB 样例消息文件以及测试结果截图的文件夹<br>RandMsgGen.py        生成足够随机的样例消息文件<br>SM3hmac.c                作品主程序<br>sm3hmac.out            Linux 下 gcc 编译 SM3hmac.c 生成的可执行文件<br>README.md                README 文件，作品说明以及使用说明</p>
<h4 id="RandMsgGen-py"><a href="#RandMsgGen-py" class="headerlink" title="RandMsgGen.py"></a>RandMsgGen.py</h4><p>生成chrAmount指定大小级的生成文件。该值用于控制随机生成的消息字符个数。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">chrAmount = <span class="number">2</span>**<span class="number">19</span> <span class="comment"># 调节字符个数</span></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> range(chrAmount):</span><br><span class="line">    randMsg+=chr(random.choice([ random.randint(r[<span class="number">0</span>],r[<span class="number">1</span>]) <span class="keyword">for</span> r <span class="keyword">in</span> chrSet]))</span><br></pre></td></tr></table></figure>

<h4 id="SM3hmac-c"><a href="#SM3hmac-c" class="headerlink" title="SM3hmac.c"></a>SM3hmac.c</h4><p>核心代码。集成了SM3哈希函数的实现、基于SM3的HMAC计算函数的实现以及对以上功能的测试函数。</p>
<h3 id="测试指标"><a href="#测试指标" class="headerlink" title="测试指标"></a>测试指标</h3><p>Hash函数部分完全根据国家密码管理局发布的《SM3密码杂凑算法》标准文档编写完成，同时对标准所给出的示例做了校验测试，本程序对标准所提供的示例消息计算出的杂凑值与标准杂凑值相同。</p>
<p>此外，本程序采用的HMAC算法完全依据RFC2104标准实现，并对样例测试结果值进行了正确性验证。验证方法是：利用Go语言现有的crypto/hmac库，以及 苏州同济区块链研究院有限公司 的基于Go语言的国密SM3算法库，两者结合运算得到HMAC值，验证本程序对相同样例消息的计算结果。<br>并且性能计时评价用秒计时，计算速度MBps衡量。</p>

    </div>
    
    
    

      <footer class="post-footer">
          
          <div class="post-tags">
              <a href="/tags/C/" rel="tag"><i class="fa fa-tag"></i> C++</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2021/11/24/cppadv-const/" rel="prev" title="探究C++语法细节 const探究">
      <i class="fa fa-chevron-left"></i> 探究C++语法细节 const探究
    </a></div>
      <div class="post-nav-item">
    <a href="/2021/11/26/findord/" rel="next" title="数论-原根">
      数论-原根 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E5%9F%BA%E4%BA%8E-SM3-%E7%AE%97%E6%B3%95%E7%9A%84-HMAC-%E5%BF%AB%E9%80%9F%E5%AE%9E%E7%8E%B0"><span class="nav-number">1.</span> <span class="nav-text">基于 SM3 算法的 HMAC 快速实现</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%AE%80%E4%BB%8B"><span class="nav-number">2.</span> <span class="nav-text">简介</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#SM3"><span class="nav-number">2.1.</span> <span class="nav-text">SM3</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#HMAC"><span class="nav-number">2.2.</span> <span class="nav-text">HMAC</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BB%A3%E7%A0%81%E5%8F%82%E8%80%83"><span class="nav-number">2.3.</span> <span class="nav-text">代码参考</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#RandMsgGen-py"><span class="nav-number">2.3.1.</span> <span class="nav-text">RandMsgGen.py</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#SM3hmac-c"><span class="nav-number">2.3.2.</span> <span class="nav-text">SM3hmac.c</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E6%B5%8B%E8%AF%95%E6%8C%87%E6%A0%87"><span class="nav-number">2.4.</span> <span class="nav-text">测试指标</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Sekla"
      src="/images/avatar.jpg">
  <p class="site-author-name" itemprop="name">Sekla</p>
  <div class="site-description" itemprop="description">Sekla</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">100</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">23</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">14</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/ShenTiao" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;ShenTiao" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:584892986@qq.com" title="E-Mail → mailto:584892986@qq.com" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



      </div>

      <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1416875904&auto=0&height=66"></iframe>
      
    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Sekla</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-area"></i>
    </span>
    <span title="站点总字数">288k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">4:22</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script size="300" alpha="0.6" zIndex="-1" src="/lib/canvas-ribbon/canvas-ribbon.js"></script>
  <script src="/lib/anime.min.js"></script>
  <script src="/lib/velocity/velocity.min.js"></script>
  <script src="/lib/velocity/velocity.ui.min.js"></script>

<script src="/js/utils.js"></script>

<script src="/js/motion.js"></script>


<script src="/js/schemes/muse.js"></script>


<script src="/js/next-boot.js"></script>




  















  

  
      

<script>
  if (typeof MathJax === 'undefined') {
    window.MathJax = {
      loader: {
        source: {
          '[tex]/amsCd': '[tex]/amscd',
          '[tex]/AMScd': '[tex]/amscd'
        }
      },
      tex: {
        inlineMath: {'[+]': [['$', '$']]},
        tags: 'ams'
      },
      options: {
        renderActions: {
          findScript: [10, doc => {
            document.querySelectorAll('script[type^="math/tex"]').forEach(node => {
              const display = !!node.type.match(/; *mode=display/);
              const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
              const text = document.createTextNode('');
              node.parentNode.replaceChild(text, node);
              math.start = {node: text, delim: '', n: 0};
              math.end = {node: text, delim: '', n: 0};
              doc.math.push(math);
            });
          }, '', false],
          insertedScript: [200, () => {
            document.querySelectorAll('mjx-container').forEach(node => {
              let target = node.parentNode;
              if (target.nodeName.toLowerCase() === 'li') {
                target.parentNode.classList.add('has-jax');
              }
            });
          }, '', false]
        }
      }
    };
    (function () {
      var script = document.createElement('script');
      script.src = '//cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js';
      script.defer = true;
      document.head.appendChild(script);
    })();
  } else {
    MathJax.startup.document.state(0);
    MathJax.texReset();
    MathJax.typeset();
  }
</script>

    

  

<script src="/live2dw/lib/L2Dwidget.min.js?094cbace49a39548bed64abff5988b05"></script><script>L2Dwidget.init({"pluginRootPath":"live2dw/","pluginJsPath":"lib/","pluginModelPath":"assets/","tagMode":false,"debug":false,"model":{"jsonPath":"/live2dw/assets/shizuku.model.json"},"display":{"position":"left","width":250,"height":500},"mobile":{"show":false},"react":{"opacity":0.9},"log":false});</script></body>
</html>

<script type="text/javascript" src="/js/src/love.js"></script>
